package cn.iocoder.yudao.module.diy.api.addon;

import cn.hutool.json.JSONArray;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.diy.ApiConstants;
import cn.iocoder.yudao.module.diy.pojo.Addon;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.security.PermitAll;
import java.util.List;

@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Tag(name = "RPC 服务 - 插件用于创建租户的时候生成装修页面")
public interface AddonApi {
    String PREFIX = ApiConstants.PREFIX+"/addon";

    @GetMapping(PREFIX + "/create")
    @Operation(summary = "创建装修模板")
    @Parameter(name = "tenantId", description = "租户id", example = "1", required = true)
    @PermitAll
    CommonResult<Long> createAddon(@RequestParam("tenantId") Long tenantId,@RequestParam("siteId") Long siteId);

    @GetMapping(PREFIX + "/getList")
    @Operation(summary = "获取插件列表")
    @Parameter(name = "tenantId", description = "租户id", example = "1", required = true)
    @PermitAll
    CommonResult<JSONArray> getAddonList(@RequestParam("tenantId") Long tenantId,@RequestParam("siteId") Long siteId);
}
